1 REM *** VIDEO SETUP *** 2 REM CREATES 'GYPSY VIDEO' FOR 'GYPSY' 5 POKE 55,255:POKE 56,127:POKE 643,255:POKE 644,127:PRINT "[147]" 7 F$=" ":C0%=0:C1%=0:C2%=0:C3%=0:C4%=0:C5%=0:C6%=0:SP%=0 8 DEF FN PG(X)=INT(X/256):DEF FN LO(X)=X-256*(INT(X/256)) 10 GOSUB 90:GOSUB 600 12 PRINT "[147]";:GOSUB 95:GOSUB 700:GOSUB 2000 13 GOSUB 900 14 SYS 38046:POKE 648,140 15 REM ** ENABLE SPRITES 16 FOR I=0 TO 199:NEXT:POKE ES,31:POKE 36839,32 17 PRINT LL$BL$LL$"PRESS BUTTON[146] TO CREATE 'GYPSY VIDEO'";:GOTO 100 19 REM ** LOAD SUBROUTINE 20 FOR I=XB TO XE:READ A:POKE I,A:NEXT:PRINT ".[146]";:RETURN 90 POKE 53265,0:RETURN 95 POKE 53265,91:RETURN 98 REM *** ACTION LOOP *** 100 IF C0%>0 THEN C0%=0:GOTO 300 196 GOTO 100 298 REM *** END HANDLING *** 299 REM ** PUT VIDEO MEMORY BACK TO FIRST BLOCK, AND SCREEN MEMORY TO 1024 300 GOSUB 90:POKE ES,0:REM DISABLE SPRITES 304 REM RESTORE VIDEO/SCREEN MEMORY 305 POKE 56578,PEEK(56578)OR3:POKE 56576,(PEEK(56576)AND 252)OR 3 310 POKE 53272,20:POKE 648,4:SYS 40768 360 POKE 37894,PEEK(45):POKE 37895,PEEK(46) 365 POKE 43,0:POKE 44,128:POKE 45,255:POKE 46,159 370 SAVE "@0:GYPSY VIDEO",8,1 375 POKE 43,1:POKE 44,8:POKE 45,PEEK(37894):POKE 46,PEEK(37895) 380 POKE 657,0:POKE 792,71:POKE 808,237 385 GOSUB 95:POKE 37952,0:POKE 37953,0 390 SYS 65126 598 REM *** ARRANGE MEMORY *** 600 VB=32768:POKE 56578,PEEK(56578)OR3:POKE 56576,(PEEK(56576)AND 252)OR 1 602 SB=0:POKE 53272,(SB*16)+4:SB=VB+1024*SB 604 BB=SB/256:POKE 648,BB 611 REM ** SPRITE COLOR TABLE 612 CT(0)=53287:FOR I=1 TO 7:CT(I)=CT(I-1)+1:NEXT 614 HT(0)=53248:FOR I=1 TO 7:HT(I)=HT(I-1)+2:NEXT 616 VT(0)=53249:FOR I=1 TO 7:VT(I)=VT(I-1)+2:NEXT 618 HR=53264 620 ES=53269 622 POKE 53271,0:POKE 53277,0:POKE 53275,0:POKE 53276,30 628 EM=53276 630 POKE 53285,15:POKE 53286,7 635 FOR I=0 TO 7:BC(I)=255-BS(I):NEXT 638 REM *** INITIALIZE VALUES *** 640 PRINT "[154]"; 642 POKE 53281,0 644 POKE 53280,0 646 POKE CT(0),7:POKE CT(1),5:POKE CT(2),2:POKE CT(3),6:POKE CT(4),12 659 REM *** ML TABLE SETUP *** 661 POKE 37920,4:POKE 37921,4 663 POKE 37922,1 665 POKE 37923,0 667 POKE 37924,1:POKE 37925,1 669 POKE 37936,1 671 POKE 37940,1 673 POKE 37941,0 675 POKE 37926,3:POKE 37928,3 677 POKE 37927,0:POKE 37935,0:POKE 37943,0 679 POKE 53282,1:POKE 53283,7:POKE 53284,9 694 POKE 657,128 696 RETURN 699 REM *** INTRO SCREEN *** 700 PRINT "[147]"TAB(14)"[199][217][208][211][217][160][208][201][204][207][212]" 710 PRINT:PRINT TAB(6)"[217][207][213][210][160][211][200][201][208][160][201][211][160][194][197][201][206][199][160][208][210][197][208][193][210][197][196][146]":PRINT:PRINT 715 RETURN 898 REM *** SPRITE POSITIONS *** 900 FOR I=1 TO 4:POKE HT(I),20+INT(RND(9)*220) 901 POKE VT(I),50+INT(RND(9)*190):NEXT 902 POKE HR,0 909 REM ** PUT STARS ON THE SCREEN 910 PRINT "[147]";:FOR I=0 TO 49:POKE VB+INT(RND(9)*1024),46:NEXT 915 FOR I=0 TO 8:POKE VB+INT(RND(9)*1024),42:NEXT 919 REM ** STARSHIP POSITION 920 POKE 53248,175:POKE 53249,150 921 REM ** STARSHIP DIRECTION 922 POKE VB+1016,16 930 LL$="" 931 BL$=" ":BL$=BL$+BL$+" " 946 RETURN 1998 REM *** MACHINE LANGUAGE *** 1999 REM ** STARTUP SYS ROUTINE 2000 POKE 37888,PEEK(788):POKE 37889,PEEK(789) 2001 XB=38046:XE=38079:GOSUB 20 2002 REM SET INTERR.VECTOR TO INTERR.HANDLER#1 AND SCANLINE 234 2003 REM SEI LDA#0 STA 788 LDA#154 STA 789 LDA#234 STA 53266 2004 DATA 120,169,0,141,20,3,169,154,141,21,3,169,234,141,18,208 2005 REM HIGH BIT, ENABLE SCAN INTERR., DISABLE TIMER INTERR., QUIT 2006 REM LDA 53265 AND#127 STA 53265 LDA#1 STA 53274 STA 56333 CLI RTS 2007 DATA 173,17,208,41,127,141,17,208,169,1,141,26,208,141,13,220,88,96 2019 REM *** ANIMATION SHELL *** 2020 XB=38144:XE=38176:GOSUB 20 2023 DATA 206,32,148,240,3,108,10,148 2026 DATA 173,33,148,141,32,148 2029 DATA 206,34,148,208,5,169,8,141,34,148,174,34,148,202 2032 DATA 173,35,148,240,6 2035 A=192:B=248:FOR I=38177 TO 38219 STEP 6:POKE I,189:POKE I+1,A:POKE I+2,148 2036 POKE I+3,141:POKE I+4,B:POKE I+5,131:A=A+8:B=B+1:NEXT 2039 POKE 38225,108:POKE 38226,10:POKE 38227,148 2049 REM *** MOVEMENT COUNTER *** 2050 XB=38272:XE=38288:GOSUB 20 2051 X=38272:POKE 37896,FN LO(X):POKE 37897,FN PG(X) 2052 POKE 37898,FN LO(X):POKE 37899,FN PG(X) 2055 DATA 206,36,148,240,3,108,12,148 2058 DATA 173,37,148,141,36,148,108,2,148 2059 REM ** BITSET SUBROUTINE ** 2060 XB=38314:XE=38323:GOSUB 20 2063 DATA 185,74,148,13,16,208,141,16,208,96 2069 REM ** BITCLEAR SUBROUTINE ** 2070 XB=38324:XE=38335:GOSUB 20 2073 DATA 185,74,148,73,255,45,16,208,141,16,208,96 2099 REM *** XMOVE *** 2100 XB=38400:XE=38467:GOSUB 20 2103 DATA 169,1,57,75,148,240,3,32,128,150 2109 DATA 169,2,57,75,148,240,3,32,192,150 2119 DATA 169,4,57,75,148,240,17,185,74,148,45,16,208,240,6 2122 DATA 32,0,151,76,44,150,32,64,151 2128 DATA 169,8,57,75,148,208,1,96,185,74,148,45,16,208,240,4 2131 DATA 32,128,151,96,32,192,151,96 2139 REM *** UPMOVE SUBROUTINE *** 2140 XB=38528:XE=38561:GOSUB 20 2143 DATA 190,1,208,202,138,217,90,148,208,3,32,146,150,138,153,1,208,96 2146 DATA 173,48,148,208,4,232,76,247,149,190,91,148,202,76,247,149 2159 REM *** DOWNMOVE SUBROUTINE *** 2160 XB=38592:XE=38625:GOSUB 20 2163 DATA 190,1,208,232,138,217,91,148,208,3,32,210,150,138,153,1,208,96 2166 DATA 173,48,148,208,4,202,76,247,149,190,90,148,232,76,247,149 2179 REM *** LEFTMOVE (HI BIT SET) *** 2180 XB=38656:XE=38669:GOSUB 20 2183 DATA 190,0,208,202,16,3,32,180,149,138,153,0,208,96 2199 REM *** LEFTMOVE (HI BIT CLR) *** 2200 XB=38720:XE=38756:GOSUB 20 2203 DATA 190,0,208,202,138,217,106,148,208,3,32,82,151,138,153,0,208,96 2206 DATA 173,48,148,208,4,232,76,247,149,190,107,148,202,32,170,149,76,247,149 2219 REM *** RIGHTMVE (HI BIT SET) *** 2220 XB=38784:XE=38820:GOSUB 20 2223 DATA 190,0,208,232,138,217,107,148,208,3,32,146,151,138,153,0,208,96 2226 DATA 173,48,148,208,4,202,76,247,149,190,106,148,232,32,180,149,76,247,149 2239 REM *** RIGHTMVE (HI BIT CLR) *** 2240 XB=38848:XE=38861:GOSUB 20 2243 DATA 190,0,208,232,208,3,32,170,149,138,153,0,208,96 2399 REM *** BASIC MOVEMENT HANDLER *** 2400 XB=38336:XE=38346:GOSUB 20 2403 DATA 160,59,177,45,170,188,56,148,76,0,150 2469 REM ** REPORT NON-SPRITE-0 WRAPS AND EDGES TO BASIC 2470 XB=38391:XE=38399:GOSUB 20 2473 DATA 192,0,208,1,96,140,55,148,96 2499 REM *** READ JOYSTICK *** 2500 XB=38912:XE=38972:GOSUB 20 2502 X=38912:POKE 37890,FN LO(X):POKE 37891,FN PG(X) 2508 DATA 173,0,220,141,45,148,41,16,208,8,169,1,141,39,148,32,0,153 2511 DATA 173,45,148,41,15,201,15,208,3,108,12,148,73,15,141,75,148,32,128,152 2514 DATA 160,0,32,0,150,32,160,152,173,4,148,141,10,148 2516 DATA 173,5,148,141,11,148,108,12,148 2529 REM *** INTERR.MOVE.HANDLER *** 2530 XB=38976:XE=39009:GOSUB 20 2531 POKE 37892,FN LO(XB):POKE 37893,FN PG(XB) 2534 DATA 160,0,32,0,150,32,160,152 2537 DATA 206,40,148,208,243,173,38,148,141,40,148 2540 DATA 173,8,148,141,10,148,173,9,148,141,11,148,108,12,148 2549 REM *** SET SHAPE 0 *** 2550 XB=39040:XE=39057:GOSUB 20 2553 DATA 173,35,148,208,9,172,75,148,185,63,148,141,248,131,32,64,153,96 2569 REM ** SPRITE 0 COLLISION ROUTINE 2570 XB=39072:XE=39111:GOSUB 20 2573 DATA 173,52,148,240,16,173,30,208,141,41,148,41,1,240,6 2575 DATA 32,80,153,76,208,152 2578 DATA 173,53,148,240,13,173,31,208,41,1,240,3,32,112,153,76,208,152,96 2579 REM ** UNMOVE ** 2580 XB=39120:XE=39148:GOSUB 20 2583 DATA 169,1,141,40,148,172,75,148,185,121,148,141,75,148 2586 DATA 160,0,32,0,150,172,75,148,185,121,148,141,75,148,96 2599 REM ** INTERRUPT HANDLER 1 ** 2600 XB=39424:XE=39449:GOSUB 20 2601 FOR I=36856 TO 36860:POKE I,48:NEXT 2602 REM CLEAR INTERR.FLAG, RESET VECTOR, SET NEW SCANLINE 2603 REM LDA#15 STA 53273 LDA#64 STA 788 LDA#254 STA 53266 2604 DATA 169,15,141,25,208,169,64,141,20,3,169,254,141,18,208 2605 REM CHANGE SCREEN POINTER AND QUIT 2606 REM LDA#52 STA 53272 PLA TAY PLA TAX PLA RTI 2607 DATA 169,52,141,24,208,104,168,104,170,104,64 2615 FOR I=35840 TO 35903:POKE I,0:NEXT 2620 XB=39488:XE=39510:GOSUB 20 2621 REM CLEAR INTERR.FLAG, RESET VECTOR, SET NEW SCANLINE 2622 REM LDA#15 STA 53273 LDA#0 STA 788 LDA#234 STA 53266 2623 DATA 169,15,141,25,208,169,0,141,20,3,169,234,141,18,208 2624 REM SET SCREEN POINTER, JUMP TO ANIM. SHELL 2625 REM LDA#4 STA 53272 JMP 38144 2626 DATA 169,4,141,24,208,76,0,149 2699 REM ** BASIC VARIABLE SUBROUTINES 2700 XB=39168:XE=39174:GOSUB 20 2701 REM ** REPORT FIREBUTTON - C0% 2703 DATA 160,10,169,1,145,45,96 2709 REM ** REPORT SPRITES TO BASIC 2710 XB=39184:XE=39222:GOSUB 20 2711 REM C1%=EDGEWRAP, C2%=S/S COLLIS. 2713 DATA 160,17,173,55,148,240,2,145,45,160,24,173,49,148,240,2,145,45 2714 REM C3%=S/FOREG.COLLIS. 2716 DATA 160,31,173,50,148,240,2,145,45 2718 DATA 169,0,141,49,148,141,50,148,141,55,148,96 2719 REM ** REPORT MOVEMENT 2720 XB=39232:XE=39241:GOSUB 20 2721 REM C4% 2723 DATA 160,38,169,1,145,45,141,47,148,96 2729 REM ** REPORT SPRITE 0 BOUNCE/S 2730 XB=39248:XE=39257:GOSUB 20 2731 REM C5% 2733 DATA 160,45,173,41,148,41,254,145,45,96 2739 REM ** REPORT SPRITE 0 BOUNCE/F 2740 XB=39280:XE=39289:GOSUB 20 2741 REM C6% 2743 DATA 160,52,169,1,145,45,141,42,148,96 2898 REM *** WRAPUP *** 2900 XB=40704:XE=40741:GOSUB 20 2901 REM ** SET COLLISION VECTOR 2902 X=40704:POKE 37900,FN LO(X):POKE 37901,FN PG(X) 2908 DATA 173,30,208,141,49,148,173,31,208,141,50,148,32,16,153 2909 REM MOVE THE NEXT PLANET 2910 REM LDX 37934 DEX BNE+2 LDX #4 STX 37934 LDY(37944),X JSR 38400 2911 DATA 174,46,148,202,208,2,162,4,142,46,148,188,56,148,32,0,150 2915 REM END INTERRUPT ROUTINE 2916 REM PLA,TAY,PLA,TAX,PLA,RTI 2917 DATA 104,168,104,170,104,64 2949 REM ** RESTORE VIDEO (UNSYS) 2950 XB=40768:XE=40792:GOSUB 20 2951 REM SET INTERR. VECTOR TO NORMAL HOUSEKEEPING, TIMED INTERRUPTS 2952 REM SEI LDA 37888 STA 788 LDA 37889 STA 789 2953 DATA 120,173,0,148,141,20,3,173,1,148,141,21,3 2954 REM LDA#0 STA 53274 LDA#129 STA 56333 CLI RTS 2955 DATA 169,0,141,26,208,169,129,141,13,220,88,96 2998 REM *** SET UP SPRITE SHAPES *** 2999 REM ** PLANETS 3000 FOR I=34304 TO 34816 STEP 512:FOR J=0 TO 448 STEP 64:FOR K=0 TO 20 3001 READ A:POKE I+J+K,A:NEXT 3002 FOR K=21 TO 63:POKE I+J+K,0:NEXT:NEXT:GOSUB 3985:NEXT 3009 REM ** PLANET 1 SHAPE DATA 3010 DATA 0,40,0,0,175,0,82,191,192,82,175,128,2,191,128,0,171,0,0,40,0 3011 DATA 0,40,0,0,190,0,2,255,128,5,190,128,5,254,128,0,175,0,0,40,0 3012 DATA 0,40,0,0,250,0,3,254,128,2,90,128,3,90,128,0,190,0,0,40,0 3013 DATA 0,40,0,0,234,0,3,250,128,3,229,128,3,229,128,0,250,0,0,40,0 3014 DATA 0,40,0,0,170,0,3,234,80,3,170,80,3,170,128,0,234,0,0,40,0 3015 DATA 0,40,0,0,170,20,3,170,212,2,170,128,2,170,192,0,170,0,0,40,0 3016 DATA 0,40,0,0,170,64,2,171,192,2,170,192,2,171,192,0,170,0,0,40,0 3017 DATA 0,40,0,5,171,0,6,175,192,2,171,192,2,175,192,0,170,0,0,40,0 3019 REM ** PLANET 2 SHAPE DATA 3020 DATA 0,40,0,3,170,192,62,170,148,162,170,143,42,255,252,2,255,192,0,40,0 3021 DATA 0,40,0,3,106,192,61,106,188,241,106,143,62,171,252,2,171,192,0,40,0 3022 DATA 0,24,0,3,90,192,61,90,188,81,90,143,63,234,188,3,234,128,0,24,0 3023 DATA 0,20,0,3,86,192,61,86,188,241,86,138,61,255,168,1,255,128,0,20,0 3024 DATA 0,20,0,3,85,128,61,85,104,241,85,74,63,223,252,3,223,192,0,20,0 3025 DATA 0,20,0,3,149,192,62,149,124,242,149,79,63,253,252,3,253,192,0,20,0 3026 DATA 0,40,0,2,169,192,62,169,124,242,169,79,63,255,252,3,255,192,0,40,0 3027 DATA 0,40,0,2,170,0,42,170,188,162,170,143,63,255,212,3,255,192,0,40,0 3058 GOSUB 3985 3059 REM ** SPRITE ANIMATION TABLES 3060 FOR I=38088 TO 38112 STEP 8:FOR J=0 TO 7:READ A:POKE I+J,A:NEXT:NEXT 3061 REM ** ANIMATION TABLE DATA 3062 DATA 24,25,26,27,28,29,30,31 3063 DATA 32,33,34,35,36,37,38,39 3064 DATA 27,26,25,24,31,30,29,28 3065 DATA 37,36,35,34,33,32,39,38 3098 REM *** SPRITE 0 SHAPES *** 3099 REM ** SPRITE 0 DIRECTION TABLE 3100 FOR I=37952 TO 37961:READ A:POKE I,A:NEXT:GOSUB 3985 3101 DATA 16,20,0,22,23,21,0,18,17,19 3102 REM ** SPRITE 0 ANIMATION TABLE 3103 FOR I=0 TO 7:POKE 38080+I,16+I:NEXT 3104 REM ** SPRITE 0 SHAPES 3105 FOR I=33792 TO 34240 STEP 64:FOR J=0 TO 18 STEP 3 3106 READ A:POKE I+J,A:POKE I+J+1,0:POKE I+J+2,0:NEXT 3107 FOR J=21 TO 63:POKE I+J,0:NEXT:NEXT:GOSUB 3985 3109 REM ** SPRITE 0 DATA 3110 DATA 8,28,28,28,54,34,0 3111 DATA 6,14,28,120,240,48,32 3112 DATA 0,224,62,31,62,224,0 3113 DATA 32,48,240,120,28,14,6 3114 DATA 0,34,54,28,28,28,8 3115 DATA 4,12,15,30,56,112,96 3116 DATA 0,7,124,248,124,7,0 3117 DATA 96,112,56,30,15,12,4 3298 REM ** SPRITE MOVEMENT DATA 3300 X=0:FOR I=37944 TO 37951:POKE I,X:X=X+2:NEXT 3305 X=1:FOR I=37962 TO 37976 STEP 2:POKE I,X:X=X*2:NEXT 3310 FOR I=37963 TO 37977 STEP 2:READ A:POKE I,A:NEXT 3311 DATA 0,5,6,10,9,0,0,0 3316 FOR I=37978 TO 37992 STEP 2:READ A:POKE I,A:NEXT 3317 DATA 50,43,43,43,43,43,43,43 3319 FOR I=37979 TO 37993 STEP 2:READ A:POKE I,A:NEXT 3320 DATA 231,242,242,242,242,242,242,242 3322 FOR I=37994 TO 38008 STEP 2:READ A:POKE I,A:NEXT 3323 DATA 23,0,0,0,0,0,0,0 3325 FOR I=37995 TO 38009 STEP 2:READ A:POKE I,A:NEXT 3326 DATA 80,87,87,87,87,87,87,87 3328 FOR I=38010 TO 38019:READ A:POKE I,A:NEXT 3329 DATA 2,1,0,8,10,9,0,4,6,5 3331 POKE 37934,1 3985 PRINT "![146]"; 3990 RETURN